package org.wmq.positiontoshop.common;

import org.springframework.stereotype.Component;
import org.wmq.positiontoshop.model.DO.User;

public class UserContext {
    private static final ThreadLocal<User> threadLocal = new ThreadLocal<>();

    public static void setUser(User user) {
        threadLocal.set(user);
    }

    public static User getUser() {
        return threadLocal.get();
    }

    public static void remove() {
        threadLocal.remove();
    }

}
